// Copyright DustedPixels.com 2008. All rights reserved.

package com.dustedpixels.jasmin.chips;

/**
 * @author micapolos@gmail.com (Michal Pociecha-Los)
 */
public final class ULA implements Chip {
  public short ADDRESS;
  public boolean ADDRESS_ACTIVE;
  public byte DATA;
  public boolean DATA_ACTIVE;
  public boolean RD;
  public boolean WR;
  public boolean MREQ;
  public boolean IORQ;
  
  private final Chip chip;
  
  private int chipCycle = 4;

  public ULA(Chip chip) {
    this.chip = chip;
  }
  
  public void update() {
    if (--chipCycle == 0) {
      chip.update();
      chipCycle = 4;   
    }
  }
}
